<?php
require_once('TVB/ObjectRecord/all.php');
require_once('TVB/MstatWebService/Client/requires.php');
require_once('TVB/mytvplus/portal_service/common/util/CommonUtils.class.php');
require_once('TVB/mytvplus/portal_service/common/util/P_Portal.class.php');
require_once('TVB/mytvplus/portal_service/common/util/NewPortalData.class.php');
require_once('TVB/mytvplus/portal_service/common/util/LuceneXml.class.php');
require_once('TVB/mytvplus/portal_service/common/AppConfiguration.class.php');
require_once('TVB/mytvplus/portal_service/common/model/model.class.php');
function __autoload($class)
{
    try {
        if(file_exists("/opt/php/lib/php/TVB/mytvplus/portal_service/model/{$class}.php")){
            require "TVB/mytvplus/portal_service/model/{$class}.php";
        }else{
            throw new Exception("No such file: /opt/php/lib/php/TVB/mytvplus/portal_service/model/{$class}.php");
        }
    } catch(Exception $e){
        error_log(print_r($e, 1));
    }
}

Model::$dbo['r'] = CommonUtils::getDbConn(); 
Model::$dbo['w'] = CommonUtils::getDbConn(1); 
?>
